package com.xmall.msg.entity.order;

import com.xmall.msg.base.BaseMsg;
import com.xmall.msg.base.MsgSourceType;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class OrderCreateMsg extends BaseMsg implements Serializable {

    /**
     * 订单ID
     */
    private Long orderId;

    /**
     * 购物车ID列表
     */
    private List<Long> cartIds;

    public OrderCreateMsg build(MsgSourceType msgSourceType, String exchange, String routingKey) {
        super.build(msgSourceType, exchange, routingKey);
        return this;
    }

    private void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    private void setCartIds(List<Long> cartIds) {
        this.cartIds = cartIds;
    }

    public OrderCreateMsg orderId(Long orderId) {
        this.orderId = orderId;
        return this;
    }

    public OrderCreateMsg cartIds(List<Long> cartIds) {
        this.cartIds = cartIds;
        return this;
    }
}
